/**
 * 封装组织架构的请求api
 */

// 引入axios
import request from '@/utils/request'
/**
* @description:获取部门列表
* @param {}
* @return:Promise
*/
export const loadDepartment = () => request.get('/company/department')

/**
* @description:获取员工列表
* @param
* @return: Promise
*/
export const userSimple = () => request.get('/sys/user/simple')

/**
* @description:添加一个部门
* @param {Object} 添加数据对象
* @return: Promise
*/
export const addDepartment = data => request.post('/company/department', data)

/**
* @description:g根据id 删除部门
* @param {String} id
* @return: Promise
*/
export const deleteDepartment = id => request.delete(`/company/department/${id}`)

/**
* @description:根据id 获取部门详情
* @param {String} id
* @return: Promise
*/
export const getDepartmentsInfo = id => request.get(`/company/department/${id}`)

/**
* @description:修改部门
* @param {Object} 部门信息
* @return: Promise
*/
export const updateDepartment = data => request.put(`/company/department/${data.id}`, data)
